<?php
/**
 * @author Sonnk
 * @copyright 2011
 */
 
class incMenutop extends CI_Include
{
	function __construct()
	{
	    parent::__construct();
		$data = new stdClass();
		$data->datas =  $this->model
							 ->table('hinhthuckls')
							 ->select('codes,names,id')
							 ->where('isdelete',0)
						 	 ->order_by('names')
							 ->find_all();
							
		$query = $this->model
							 ->table('klgb')
							 ->select('loaikl, count(1) as total')
							->where('isdelete',0)
							->group_by('loaikl')
							->find_all();
											
	    $arr = array();
		foreach($query as $item){
			$arr[$item->loaikl] = $item->total;
		}
		$data->arrs = $arr;
		$this->load->incView($data);
	}
}